//
//  UIViewController+SHDrawerController.m
//  SHDrawerController
//
//  Created by UUPlant on 2022/4/8.
//

#import "UIViewController+SHDrawerController.h"

@implementation UIViewController (SHDrawerController)

- (SHDrawerController *)sh_drawerViewController {
    UIViewController *parentViewController = self.parentViewController;
    while (parentViewController != nil) {
        if([parentViewController isKindOfClass:[SHDrawerController class]]){
            return (SHDrawerController *)parentViewController;
        }
        parentViewController = parentViewController.parentViewController;
    }
    return nil;
}

@end
